<div class="roles form">
{{$this->Html->script(array('jquery/jquery.form.js'))}}
<?PHP
	echo $this->MForm->create('Style',array('type'=>'file','id'=>'StyleAdminAddstyleForm','data-noajax'=>true));
?>
        <fieldset>
        <?php
        
        echo $this->MForm->input('name');
        echo $this->MForm->input('slug');
		?>
		<div class="form-group">
			<label class="col-sm-2 control-label" for="StyleVariables">风格variables文件</label>
			<div class="col-sm-10 controls text">
				<input type="file" id="StyleVariables" style="height:32px;" name="data[Style][variables]">
			</div>
		</div>
		<!-- echo $this->MForm->file('variables'); -->
		<?php
		echo $this->MForm->input('css_content');
		echo $this->MForm->hidden('published',array('value'=>1));
        ?>
    <div class="form-group">
    	<label class="col-sm-2 control-label"></label>
    	<div class="col-sm-10 controls"><?php echo $this->MForm->submit(__('Submit'),array('id'=>'btnsubmit')); ?></div>
    </div>
    </fieldset>
	{{$this->MForm->end()}}
</div>
<div id="divToUpdate"></div>
<!-- ajax submit file. see document in.  http://jquery.malsup.com/form/ -->
<script>
var options = {
	    target:     '#divToUpdate', 
	    success:    function() { 
	        alert('Add success!'); 
	    } 
	}; 
// pass options to ajaxForm 
$('#StyleAdminAddstyleForm').ajaxForm(options);
</script>